//
//  SubjectTableHeadView.m
//  SafeFoodManagerDemo
//
//  Created by bob on 2017/11/7.
//  Copyright © 2017年 bob. All rights reserved.
//

#import "SubjectTableHeadView.h"

@interface SubjectTableHeadView()

@property(nonatomic,strong)UILabel *tipLabel;

@end

@implementation SubjectTableHeadView

-(instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    if (self=[super initWithReuseIdentifier:reuseIdentifier]) {
        
        self.tipLabel=[[UILabel alloc]initWithFrame:CGRectMake(15, 0, SCREEN_WIDTH-30, 31)];
        
        self.tipLabel.textColor=kColorRGB(0x4595e0);
        
        self.tipLabel.font=[UIFont systemFontOfSize:18];
        
        self.tipLabel.textAlignment=NSTextAlignmentLeft;
        
        self.contentView.backgroundColor=kColorRGB(0xebf3fb);
        
        [self.contentView addSubview:self.tipLabel];
        
        self.userInteractionEnabled=YES;
        
        UITapGestureRecognizer *tap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(TapAction:)];
      
        [self addGestureRecognizer:tap];
        
    }
    
    return self;
}

-(void)setHeadTitle:(NSString *)headTitle
{
    _headTitle=headTitle;
    
    self.tipLabel.text=headTitle;
    
    
}

-(void)TapAction:(UITapGestureRecognizer
                  *)tap
{
    _block();
    
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
